import CryptoJS from 'crypto-js';

const MD5_KEY = 'ifrontend.net';

export const encryptAES = (value: string) => {
  if (value == '') return '';
  const keyHex = CryptoJS.enc.Utf8.parse(MD5_KEY);
  const encrypted = CryptoJS.AES.encrypt(value, keyHex, {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.Pkcs7,
  });
  return encrypted.toString();
}